<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<!-- RichFaces tag library declaration -->
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>

<f:subview id="menuAdmin">
	<rich:toolBar styleClass="menuAll">
		<rich:dropDownMenu value="Моят профил" direction="bottom-right"
			styleClass="search">
			<rich:menuItem submitMode="none" style="width:250px;" disabled="true">
				<h:panelGrid columns="3" id="profileGridAdmin"
					style="margin-left:40px;margin-top:5px;width:250px">
					<h:outputText value="Име:" styleClass="outputTextLabel" />
					<h:outputText value="#{mbAdmin.resultUser.firstName}"
						styleClass="outputTextValue" />
					<rich:spacer width="15" />
					<h:outputText value="Презиме:" styleClass="outputTextLabel" />
					<h:outputText value="#{mbAdmin.resultUser.secondName}"
						styleClass="outputTextValue" />
					<rich:spacer width="15" />
					<h:outputText value="Фамилия:" styleClass="outputTextLabel" />
					<h:outputText value="#{mbAdmin.resultUser.thirdName}"
						styleClass="outputTextValue" />
					<rich:spacer width="15" />
					<h:outputText value="Потребител:" styleClass="outputTextLabel" />
					<h:outputText value="#{mbAdmin.resultUser.username}"
						styleClass="outputTextValue" />
					<rich:spacer width="15" />
					<h:outputText value="Стара парола:" styleClass="outputTextLabel" />
					<h:inputSecret value="#{mbAdmin.resultUser.password}" size="15" />
					<rich:spacer width="15" />
					<h:outputText value="Нова парола:" styleClass="outputTextLabel" />
					<h:inputSecret value="#{mbAdmin.newPass}" size="15" />
					<rich:spacer width="15" />
					<h:outputText value="Потвърди:" styleClass="outputTextLabel" />
					<h:inputSecret value="#{mbAdmin.validatePass}" size="15" />
					<rich:spacer width="15" />
					<h:outputText value="Ел. поща:" styleClass="outputTextLabel" />
					<h:inputText value="#{mbAdmin.resultUser.mail}" size="15" />
				</h:panelGrid>
				<a4j:commandButton style="margin-left:100px;"
					reRender="profileGridAdmin" value="Направи промените"
					action="#{mbAdmin.updateProfile}" />
			</rich:menuItem>
		</rich:dropDownMenu>
		<rich:dropDownMenu value="Операции върху преподавател"
			submitMode="ajax">
			<rich:menuItem submitMode="none">
				<a4j:commandLink id="linkNewLecturer"
					value="Регистрирай нов преподавател"
					action="#{mbAdmin.resetNewLecturer}" reRender="mdlNewLecturer"
					oncomplete="Richfaces.showModalPanel('mdlNewLecturer')">
				</a4j:commandLink>
			</rich:menuItem>
			<rich:menuItem submitMode="none">
				<a4j:commandLink id="linkEditLecturer"
					value="Промени селектирания преподавател"
					action="#{mbAdmin.loadSelectedLecturer}"
					oncomplete="Richfaces.showModalPanel('mdlEditLecturer')"
					reRender="mdlEditLecturer">
				</a4j:commandLink>
			</rich:menuItem>
			<rich:menuItem submitMode="none">
				<a4j:commandLink id="linkDeleteLecturer"
					value="Изтрий селектирания преподавател"
					action="#{mbAdmin.deleteLecturer}"
					reRender="panelTableLecturersAdmin">
				</a4j:commandLink>
			</rich:menuItem>
			<rich:menuItem submitMode="none">
				<a4j:commandLink id="linkAllTask" value="Виж качени задания"
					reRender="mdlTaskForLecturer"
					action="#{mbAdmin.generateAllTasksForLecturer}"
					oncomplete="Richfaces.showModalPanel('mdlTaskForLecturer')" />
			</rich:menuItem>
		</rich:dropDownMenu>
		<rich:dropDownMenu value="Операции върху студент" submitMode="ajax"
			direction="bottom-right" styleClass="search">
			<rich:menuItem submitMode="none">
				<a4j:commandLink value="Изтрий селектирания студент"
					action="#{mbAdmin.deleteStudent}"
					reRender="panellAllHomeworksAdmin" />
			</rich:menuItem>
			<rich:menuItem submitMode="none">
				<a4j:commandLink id="linkEditStudent"
					value="Промени селектирания студент"
					action="#{mbAdmin.loadSelectedStudent}"
					oncomplete="Richfaces.showModalPanel('mdlEditStudent')"
					reRender="mdlEditStudent" />
			</rich:menuItem>
			<rich:menuItem submitMode="none">
				<a4j:commandLink id="linkSentHomeworks" value="Изпратени домашни"
					reRender="mdlHomeworkSent"
					action="#{mbAdmin.generateAllHomeworkForStudent}"
					oncomplete="Richfaces.showModalPanel('mdlHomeworkSent')">
				</a4j:commandLink>
			</rich:menuItem>
		</rich:dropDownMenu>
		<rich:toolBarGroup location="right">
			<rich:dropDownMenu value="Търси" submitMode="ajax">
				<rich:menuItem submitMode="server" style="width:620px;"
					reRender="searchPanel" disabled="true" id="searchPanel">
					<h:panelGrid columns="2" width="100%">
						<h:panelGrid>
							<h:outputText style="margin-left:25px;"
								styleClass="outputTextValue"
								value="Критерии за търсене на преподавател" />
							<h:panelGrid columns="2" style="margin-left:25px;">
								<h:outputText value="Име:" styleClass="outputTextLabel" />
								<h:inputText value="#{mbAdmin.searchLecturer.firstName}"
									size="15" />
								<h:outputText value="Презиме:" styleClass="outputTextLabel" />
								<h:inputText value="#{mbAdmin.searchLecturer.secondName}"
									size="15" />
								<h:outputText value="Фамилия:" styleClass="outputTextLabel" />
								<h:inputText value="#{mbAdmin.searchLecturer.thirdName}"
									size="15" />
								<h:outputText value="Титла:" styleClass="outputTextLabel" />
								<rich:comboBox value="#{mbAdmin.chooseLTitleForSearch}"
									enableManualInput="false">
									<f:selectItems value="#{mbAdmin.nomLecturerTitles}" />
								</rich:comboBox>
								<h:outputText value="ЕГН:" styleClass="outputTextLabel" />
								<h:inputText value="#{mbAdmin.searchLecturer.egn}" size="15" />
								<h:outputText value="Потребител:" styleClass="outputTextLabel" />
								<h:inputText value="#{mbAdmin.searchLecturer.username}"
									size="15" />
							</h:panelGrid>
						</h:panelGrid>
						<h:panelGrid>
							<h:outputText style="margin-left:25px;"
								styleClass="outputTextValue"
								value="Критерии за търсене на студент" />
							<h:panelGrid columns="2" style="margin-left:25px;">
								<h:outputText value="Име:" styleClass="outputTextLabel" />
								<h:inputText value="#{mbAdmin.searchStudent.firstName}"
									size="15" />
								<h:outputText value="Презиме:" styleClass="outputTextLabel" />
								<h:inputText value="#{mbAdmin.searchStudent.secondName}"
									size="15" />
								<h:outputText value="Фамилия:" />
								<h:inputText value="#{mbAdmin.searchStudent.thirdName}"
									size="15" />
								<h:outputText value="Факултетен номер:"
									styleClass="outputTextLabel" />
								<h:inputText value="#{mbAdmin.searchStudent.fn}" size="15" />
								<h:outputText value="ЕГН:" styleClass="outputTextLabel" />
								<h:inputText value="#{mbAdmin.searchStudent.egn}" size="15" />
								<h:outputText value="Потребител:" styleClass="outputTextLabel" />
								<h:inputText value="#{mbAdmin.searchStudent.username}" size="15" />
							</h:panelGrid>
						</h:panelGrid>
					</h:panelGrid>
					<a4j:commandButton value="Търси преподаватели"
						style="margin-left:100px;" action="#{mbAdmin.searchLecturer}"
						reRender="pnlAllLecturersAdmin" />
					<a4j:commandButton value="Търси студенти"
						style="margin-left:220px;" action="#{mbAdmin.searchStudent}"
						reRender="panellAllHomeworksAdmin" />
				</rich:menuItem>
			</rich:dropDownMenu>
		</rich:toolBarGroup>
	</rich:toolBar>
</f:subview>